﻿var trunPageObj;//翻页组件对像
$(initPage);
function initPage() {
	trunPageObj =  $(".pageNext").turnPage(15, exportList);
	trunPageObj.gotoPage(1);//搜索第一页
}

function queryFirstPage() {
	trunPageObj.gotoPage(1);//搜索第一页
}

function queryList() {
	$("#log_list").empty();
	var busiDate = $("#busiDate").val();
	
	var pageno=trunPageObj.getCurrentPageNo();//当前第几页
	var pagecount=trunPageObj.getPageCount();//一页多少条
	$.post("m/data_check/queryr13", {
		pageNo: pageno,
		pageSize : pagecount,
		busiDate:busiDate
	}, function(data) {
		if ($.checkErrorMsg(data) ) {
			var fileList = "";
			if(data.checkR13Page && data.checkR13Page.dataList){
				var dataList = data.checkR13Page.dataList;
				$(dataList).each(function(i) {
					fileList += "<tr class='table_td_font' bgColor='#ffffff' title='" + (dataList[i].note ? dataList[i].note  : "") + "'>";
					fileList += "<td align='center'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].formatOperTime + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].chkType + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].discAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].reservesFactAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].fullCommNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].accumAdjustAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].sdcCommAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].bankCommNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].bankInterestNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].reservesInterestNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].secInterestNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].withheldTaxAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].settleAdjustAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].clearOffsetBalNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].stamptaxOffsetBalNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].redBlueFillAmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].other1AmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].other2AmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].other3AmtNote + "</td>";
					fileList += "<td align='right'  height='25px' class='queryList_linebg' nowrap>" + dataList[i].other4AmtNote + "</td>";
					fileList += "</tr>";
				});
			}
			$("#log_list").html(fileList);
			trunPageObj.setPageData(data.checkR13Page);
		} 
	}, "json");
}

function exportList() {
	var obj = window.showModalDialog(BASE_PATH + "page/export_select.jsp","","dialogWidth:200px;dialogHeight:80px;help:no;center:yes;status:no");
	if (obj) {
		window.open(BASE_PATH +"/m/data_check/exportr13?busiDate=" + $.trim($("#busiDate").val())+ "&expType=" + obj);
	}
}